When an image is obtained by combining a plurality of images, an overlapping or common area between a plurality of images to be combined is set as an “overlapping area” (hereinafter an overlapping area is referred to as a common area). The relative positions between the plurality of images are calculated, and the positions of the plurality of images are aligned based on the relative positions. A composite image is generated by merging the plurality of images after the alignment. However, since the plurality of images are obtained at different timing with different quantity of light due to camera angle and so on, there occurs an unnatural break at the boundary of merged images (joint of images).
Therefore, a plurality of images are superimposed near the boundary (hereinafter referred to as a superimposed area) and merged in such a way that the boundary looks natural. Accordingly, the resultant composite image includes an area generated from only one image and an area generated by superposing a plurality of images.
When a moving object is shot by a camera and the moving object exists in a superimposed area in the composite image, there may be ghost images (two or more shifted images) of the moving object in the superimposed area. Therefore, it is desired that the superimposed area is smaller. However, when there are large gaps between a plurality of images to be merged, and the superimposed area is very small, the discontinuity at the boundary due to the gaps between the plurality of images cannot be suppressed.
To solve the above-mentioned problem, a method in which the width of a superimposed area may be selected by a user of a digital camera is proposed. This method is proposed, for example, by Japanese Laid-open Patent Publication No. 2000-299804.
However, the proposed method requires an operation by a camera user, and the operation is complicated. Thus, the quality of an image depends on the experience or technique of the camera user. In addition, since the width of the superimposed area is selected in advance, the composite image sometimes has a discontinuity at the boundary of a plurality of images.